import baseApi from '@/api/api'
// import { getToken, setToken, removeToken } from '@/utils/login'
import * as types from './mutation-types'

const state = {
goodItem: {}

}

const getters = {

goodItem: state => state.goodItem,
}

const mutations = {
	
	[types.GOOD_ITEM](state, payload) {
		state.goodItem = payload
	},
}

const actions = {
	//
	getFactoryWorkOrderList({ commit }, param) {
	  return baseApi.getFactoryWorkOrderList(param).then((res) => {
		return res
	  })
	},
	getUnitWorkOrderDetail({ commit }, param) {
	  return baseApi.getUnitWorkOrderDetail(param).then((res) => {
		  commit('GOOD_ITEM', res.data)
		return res
	  })
	},
	getStatusDict({ commit }, param) {
	  return baseApi.getStatusDict(param).then((res) => {
		return res
	  })
	},
	getUnitList({ commit }, param) {
	  return baseApi.getUnitList(param).then((res) => {
		return res
	  })
	},
	repairFactoryWorkOrder({ commit }, param) {
	  return baseApi.repairFactoryWorkOrder(param).then((res) => {
		return res
	  })
	},
	selfStudyWorkOrder({ commit }, param) {
	  return baseApi.repairFactoryWorkOrder(param).then((res) => {
		return res
	  })
	},
	confirmedWorkOrder({ commit }, param) {
	  return baseApi.confirmedWorkOrder(param).then((res) => {
		return res
	  })
	},
	factorySnatchWorkOrder({ commit }, param) {
	  return baseApi.factorySnatchWorkOrder(param).then((res) => {
		return res
	  })
	},
	delayApplyRepairWorkOrder({ commit }, param) {
	  return baseApi.delayApplyRepairWorkOrder(param).then((res) => {
		return res
	  })
	},
	receiveSliceCutting({ commit }, param) {
	  return baseApi.receiveSliceCutting(param).then((res) => {
		return res
	  })
	},
	getDictItemList({ commit }, param) {
	  return baseApi.getDictItemList(param).then((res) => {
		return res
	  })
	},
	scrapWorkOrder({ commit }, param) {
	  return baseApi.scrapWorkOrder(param).then((res) => {
		return res
	  })
	},
	getDelayApplyList({ commit }, param) {
	  return baseApi.getDelayApplyList(param).then((res) => {
		return res
	  })
	},
	getApplyRecord({ commit }, param) {
	  return baseApi.getApplyRecord(param).then((res) => {
		return res
	  })
	},
	getApplyInfo({ commit }, param) {
	  return baseApi.getApplyInfo(param).then((res) => {
		return res
	  })
	},
}

export default {
	// namespaced: true,
	state,
	getters,
	mutations,
	actions
}
